﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Milan.Deploy
{
	class NewVersionScanner : PeriodicScanner, IDisposable
	{
		/// <summary>
		/// This is a background scanner which uploads a file.
		/// </summary>
		/// <param name="application"></param>
		public NewVersionScanner(Application application, Client client )
			: base(application, 60 * 60, 0)
		{
			//m_download = new Download();
			m_client = client;
		}
		private Client m_client;

		/// <summary>
		/// This immediately performs a check for a new upgrade
		/// </summary>
		/// <returns></returns>
		protected override void RunOnce()
		{
			m_client.UploadEntireProductIfNeeded();
		}
		public new void Dispose()
		{
			NotBusy.WaitOne();
		}
	}
}
